<!DOCTYPE html>
<html>

<head>
    <meta name="layout" content="main2"/>
    <g:set var="entityName" value="${message(code: 'territoryTeam.label', default: 'territoryTeam')}"/>
    <title>新增区域团队</title>
</head>

<body>

<div class="main-body">
    <div class="page-wrapper">
        <!-- Page-header start -->
        <div class="page-header">
            <div class="page-header-title">
                <h4>新增区域团队</h4>
            </div>

            <div class="page-header-breadcrumb">
                <ul class="breadcrumb-title">
                    <li class="breadcrumb-item">
                        <a href="/salesDashboard/index">
                            <i class="icofont icofont-home"></i>
                        </a>
                    </li>
                    <li class="breadcrumb-item">
                        <g:link controller="territory" action="show"
                                id="${this.territoryTeam?.territory?.id}">区域列表</g:link>
                    </li>
                    <li class="breadcrumb-item"><a href="#!">新增区域团队</a>
                    </li>
                </ul>
            </div>
        </div>
        <!-- Page-header end -->
        <!-- Page-body start -->
        <div class="page-body">
            <g:if test="${flash.message}">
                <div class="message alert alert-info" role="status">${flash.message}
                    <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span
                            aria-hidden="true">×</span></button>
                </div>
            </g:if>
            <g:hasErrors bean="${this.territoryTeam}">
                <ul class="errors" role="alert">
                    <g:eachError bean="${this.territoryTeam}" var="error">
                        <li <g:if test="${error in org.springframework.validation.FieldError}">data-field-id="${error.field}"</g:if>>
                            <g:message error="${error}"/>
                        </li>
                    </g:eachError>
                </ul>
            </g:hasErrors>
        <!-- Hover table card start -->
            <div class="card">
                <div class="card-header">
                    <h5>新增区域团队</h5>

                    <div class="card-header-right">
                        <i class="icofont icofont-rounded-down"></i>
                    </div>
                </div>

                <div class="card-block">

                    <g:form action="save" class="form-horizontal">
                        <div class="form-group row">
                            <label class="col-md-2 control-label is-required">用户</label>

                            <div class="col-md-3">
                                <input class="form-control" type="hidden" name="territory.id"
                                       value="${this.territoryTeam?.territory?.id}">
                                <g:select class="form-control" name="user.id" optionKey="id"
                                          from="${this.userList}" value="${this.territoryTeam?.user?.id}"
                                          noSelection="${['': '请选择']}"></g:select>
                            </div>

                            <label class="col-md-2 control-label is-required">权限</label>

                            <div class="col-md-3">
                                <g:select class="form-control" name="teamRole.id" optionKey="id"
                                          optionValue="name"
                                          from="${com.next.TeamRole.list()}" value="${this.territoryTeam?.teamRole?.id}"
                                          noSelection="${['': '请选择']}"></g:select>
                            </div>
                        </div>


                        <div class="form-group row">
                            <label class="col-md-2 control-label">contactPermission</label>

                            <div class="col-md-3">
                                <g:select class="form-control" name="contactPermission.id" optionKey="id"
                                          optionValue="name"
                                          from="${com.next.TeamRole.list()}"
                                          value="${this.territoryTeam?.contactPermission?.id}"
                                          noSelection="${['': '请选择']}"></g:select>
                            </div>

                            <label class="col-md-2 control-label">activityPermission</label>

                            <div class="col-md-3">
                                <g:select class="form-control" name="activityPermission.id" optionKey="id"
                                          optionValue="name"
                                          from="${com.next.TeamRole.list()}"
                                          value="${this.territoryTeam?.activityPermission?.id}"
                                          noSelection="${['': '请选择']}"></g:select>
                            </div>
                        </div>


                        <div class="form-group row">
                            <label class="col-md-2 control-label">teamPermission</label>

                            <div class="col-md-3">
                                <g:select class="form-control" name="teamPermission.id" optionKey="id"
                                          optionValue="name"
                                          from="${com.next.TeamRole.list()}"
                                          value="${this.territoryTeam?.teamPermission?.id}"
                                          noSelection="${['': '请选择']}"></g:select>
                            </div>

                            <label class="col-md-2 control-label">attachmentPermission</label>

                            <div class="col-md-3">
                                <g:select class="form-control" name="attachmentPermission.id" optionKey="id"
                                          optionValue="name"
                                          from="${com.next.TeamRole.list()}"
                                          value="${this.territoryTeam?.attachmentPermission?.id}"
                                          noSelection="${['': '请选择']}"></g:select>
                            </div>
                        </div>


                        <div class="form-group row">
                            <label class="col-md-2 control-label">notePermission</label>

                            <div class="col-md-3">
                                <g:select class="form-control" name="notePermission.id" optionKey="id"
                                          optionValue="name"
                                          from="${com.next.TeamRole.list()}"
                                          value="${this.territoryTeam?.notePermission?.id}"
                                          noSelection="${['': '请选择']}"></g:select>
                            </div>

                            <label class="col-md-2 control-label">flexFieldPermission</label>

                            <div class="col-md-3">
                                <g:select class="form-control" name="flexFieldPermission.id" optionKey="id"
                                          optionValue="name"
                                          from="${com.next.TeamRole.list()}"
                                          value="${this.territoryTeam?.flexFieldPermission?.id}"
                                          noSelection="${['': '请选择']}"></g:select>
                            </div>
                        </div>


                        <div class="form-group row">
                            <label class="col-md-2 control-label">addressPermission</label>

                            <div class="col-md-3">
                                <g:select class="form-control" name="addressPermission.id" optionKey="id"
                                          optionValue="name"
                                          from="${com.next.TeamRole.list()}"
                                          value="${this.territoryTeam?.addressPermission?.id}"
                                          noSelection="${['': '请选择']}"></g:select>
                            </div>
                        </div>
                        <div class="form-group row">
                            <label class="col-md-2 control-label">开始时间</label>

                            <div class="col-md-3 datePicker">
                                <div class="input-group">
                                    <input type="text" valctrl="startTime" value="${this.territoryTeam?.startTime}"
                                           class="form-control form_date">
                                    <input type="hidden" id="startTime" name="startTime" value="date.struct">
                                    <input type="hidden" id="startTime_day" name="startTime_day" value="">
                                    <input type="hidden" id="startTime_month" name="startTime_month" value="">
                                    <input type="hidden" id="startTime_year" name="startTime_year" value="">
                                </div>
                            </div>
                            <label class="col-md-2 control-label">结束时间</label>

                            <div class="col-md-3 datePicker">
                                <div class="input-group ">
                                    <input type="text" valctrl="endTime" value="${this.territoryTeam?.endTime}"
                                           class="form-control form_date">
                                    <input type="hidden" id="endTime" name="endTime" value="date.struct">
                                    <input type="hidden" id="endTime_day" name="endTime_day" value="">
                                    <input type="hidden" id="endTime_month" name="endTime_month" value="">
                                    <input type="hidden" id="endTime_year" name="endTime_year" value="">
                                </div>

                            </div>
                        </div>


                        <div class="form-group row">
                            <div class="col-md-12">
                                <g:submitButton class="btn btn-info" name="create" value="保存"/>
                            </div>
                        </div>

                    </g:form>
                </div>
            </div>
            <!-- Hover table card end -->
        </div>

        <!-- Page-body end -->

    </div>
</div>

</body>

</html>

